package com.itheima.user.feign;

import com.itheima.user.entity.OrderEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author zhangyan
 * @date 2021/3/16 0:53
 */

@FeignClient(value = "order-service")
//@RequestMapping("/order")  多个controller的话 不在类上统一定义,写到GetMapping中
public interface OrderService {

    //服务提供方方法如何定义，这里就如何定义
    //feign调用谁 就直接把方法弄过来
    //OrderController里的方法

    @GetMapping("/order/findOrderInfoByUserId/{userId}")
    List<OrderEntity> findOrderInfoByUserId(@PathVariable("userId") Integer userId);
}
